

# include<stdio.h>
# include<windows.h>

void Test1();
void Test2();
void Circle();
int main(void ){
	Circle();

	system("pause");
	return 0;
}


/*

China 译成密码

思路：将每个字母的ASCII 码依次向后加 4

*/
//采用五个字符输入
void Test1(){
	char c1,c2,c3,c4,c5;
	printf("请输入五个字符进行加密：\n");
	scanf_s("%c%c%c%c%c",&c1,&c2,&c3,&c4,&c5);

	c1 +=4;
	c2 +=4;
	c3 +=4;
	c4 +=4;
	c5 +=4;


	printf("%c%c%c%c%c\n",c1,c2,c3,c4,c5);
	putchar(c1);putchar(c2);putchar(c3);putchar(c4);putchar(c5);putchar('\n');

	return ;
}

///采用循环输入
void Test2(){
	char str[20];
	int i = 0;
	int j = 0;

	int c;
    while( (c=getchar()) != '\n' ){  //从控制台流中读取字符，直到按回车键结束
        str[i] = c+4;
		i ++;
	}

	for(j=0;j<i;j++){
		putchar(str[j]);
	}
	putchar('\n');

	return ;
}


//求圆
void Circle(){
	float r,h;// 半径，高度
	float c,s,sq,vq,vz;//周长，面积，球表面积，球体积，柱体积
	float PI = 3.1415926;
	printf("请输入圆半径：");
	scanf("%f",&r);
	printf("请输入圆柱高：");
	scanf("%f",&h);
	c = 2 * PI * r;
	s = PI * r * r;
	sq = 4 * PI * r * r;
	vq = ( 4 / 3 ) * PI * r * r * r;
	vz = s * h;
	printf("圆周长是：%4.2f\n",c);
	printf("圆面积是：%4.2f\n",s);
	printf("圆球表面积是：%4.2f\n",sq);
	printf("圆球体积是：%4.2f\n",vq);
	printf("圆柱体积是：%4.2f\n",vz);

	return ;
}